﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YJ_Core.Entities.Utils
{
    /// <summary>
    /// 模型基类
    /// </summary>
    public class BaseEntities : DeleteBaseEntities
    {
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string CreateMan { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string UpdateMan { get; set; }
    }

    /// <summary>
    /// 软删除基类
    /// </summary>
    public class DeleteBaseEntities : IDeletedFilter
    {
        /// <summary>
        /// 删除标识
        /// </summary>
        //[SugarColumn(DefaultValue = "0", IsNullable = true)]
        public bool IsDelete { get; set; } = false;

    }
    /// <summary>
    /// 软删除接口
    /// </summary>
    public interface IDeletedFilter
    {
        /// <summary>
        /// 删除标识
        /// </summary>
        public bool IsDelete { get; set; }
    }
}
